//
//  QZMyBalanceCell.m
//  WeiWeiHaircut
//
//  Created by 超群 on 15/10/15.
//  Copyright © 2015年 超群. All rights reserved.
//

#import "QZMyBalanceCell.h"
#import "UIView+RoundView.h"

@implementation QZMyBalanceCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self setSelectionStyle:UITableViewCellSelectionStyleNone];
        [self createView];
        
    }
    return self;
}

-(void)createView{
    
    
    UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(20, 30, 40, 20)];
    label.text = @"余额: ";
    label.textColor = [UIColor darkGrayColor];
    [self.contentView addSubview:label];
    
    UILabel *price = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(label.frame)+20, 30, 100, 20)];
    price.text = @"500元";
    _price = price;
    price.textColor = [UIColor darkGrayColor];
    [self.contentView addSubview:price];
    
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    
    button.frame = CGRectMake(SCREEN_W-100, 30, 80, 20);
    
    [button setTitle:@"充值" forState:UIControlStateNormal];
    [button setTitleColor:[UIColor colorWithRed:180/255.0 green:90/255.0 blue:180/234.0 alpha:1] forState:UIControlStateNormal];
    [button addTarget:self action:@selector(buttonClick:) forControlEvents:UIControlEventTouchUpInside];
    [self.contentView addSubview:button];
    
    [self.contentView setlineFrame:CGRectMake(20, 80, SCREEN_W-20, 0.3) lineColor:[UIColor lightGrayColor] lineAlpha:0.5];
}
-(void)buttonClick:(UIButton *)btn{
    if (_myBlick) {
        _myBlick(btn);
    }
    
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
